package io.bruce.akka.common;

import java.io.Serializable;

public class MathCalculate implements Serializable {

    /**
     * 数字1
     */
    private int num1;
    /**
     * 数字2
     */
    private int num2;
    /**
     * 计算结果
     */
    private int result;
    /**
     * 操作类型
     */
    private OperateEnum type;
    /**
     * 计算结果对应的运算符
     */
    private String op;

    public MathCalculate() {
    }

    public MathCalculate(int result, OperateEnum type) {
        this.result = result;
        this.type = type;
    }

    public MathCalculate(int num1, int num2, OperateEnum type) {
        this.num1 = num1;
        this.num2 = num2;
        this.type = type;
    }

    public MathCalculate(int num1, int num2, int result, OperateEnum type) {
        this.num1 = num1;
        this.num2 = num2;
        this.result = result;
        this.type = type;
    }

    public int getNum1() {
        return num1;
    }

    public void setNum1(int num1) {
        this.num1 = num1;
    }

    public int getNum2() {
        return num2;
    }

    public void setNum2(int num2) {
        this.num2 = num2;
    }

    public int getResult() {
        return result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public OperateEnum getType() {
        return type;
    }

    public void setType(OperateEnum type) {
        this.type = type;
    }

    public String getOp() {
        return op;
    }

    public void setOp(String op) {
        this.op = op;
    }

    public static enum OperateEnum {
        ADD("+"),
        SUBTRACT("-"),
        MULTIPLY("*"),
        DIVIDE("/"),
        RESULT("="),
        ;

        private String val;

        OperateEnum(String val) {
            this.val = val;
        }

        public String getVal() {
            return val;
        }
    }
}

